import com.ssm.test.model.Stu;
import com.ssm.test.service.StuService;

import org.apache.log4j.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.List;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:spring.xml" })
public class testMybatis {
	@Autowired
	private StuService stuService;
	
	private Logger logger = LogManager.getLogger(testMybatis.class);
	
	
	@Test
	public void test() {
		List<Stu> list = stuService.getStuList();
		for (Stu stu : list) {
			logger.info(stu.getStuid() + stu.getStuname() + stu.getStusex() + stu.getStunumber());
		}
	}
}
